package com.longcai.controller.fuyoupay;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSONObject;
import com.longcai.bean.ApiResult;
import com.longcai.entity.payment.fuyou.request.ClyjFuyouBankcardChange;
import com.longcai.mapper.fuyoupay.ClyjFuyouBankcardChangeMapper;
import com.longcai.service.fuyoupay.ClyjFuyouBankcardChangeService;

/**
 * </p>
 *银行卡变更
 * @author LWK
 * @since 2019-04-17
 */
@Controller
@RequestMapping("/clyjFuyouBankcardChange")
public class ClyjFuyouBankcardChangeController {
	@Autowired  
	private ClyjFuyouBankcardChangeService bankcardChangeService;
	@Autowired
	private ClyjFuyouBankcardChangeMapper clyjFuyouBankcardChangeMapper;
	@RequestMapping("/BankcardChangeSave")
	@ResponseBody
	public ApiResult<?> recharge (@RequestBody JSONObject params){
		ApiResult<ClyjFuyouBankcardChange> cfbc=bankcardChangeService.checkout(params);
		if (cfbc.getData() instanceof ClyjFuyouBankcardChange) {
			boolean b = bankcardChangeService.insert(cfbc.getData());
			if(b){
				return ApiResult.success("银行卡变更成功");
			}
		}
		return ApiResult.fail(cfbc.getData());
	}
}

